import { getText } from './service';

export default {
  namespace: 'goods',
  state: {},

  effects: {
    *fetch(_: any, { call, put }: any) {
      const { text } = yield call(getText);
      yield put({
        type: 'save',
        payload: {
          text,
        },
      });
    },
  },

  reducers: {
    save(state: any, { payload }: any) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
